<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文档测试</title>
   
</head>
<body>
    <script>
        function on(){
            alert("ok")
            var a=document.getElementById("ona")
            a.src='https://img2.imgtp.com/2024/05/02/ZLmctZjk.png'
            document.getElementById("a").innerHTML = "Hello Kitty."
        }
    </script>
    <button onclick="on()">按钮</button>
    <br>
    <span id ='a'> 这是一个文本测试</span>
    <img id='ona' onclick="on()" src="https://img2.imgtp.com/2024/05/05/e3yZJetW.png">
</body>
</html>